{$layout "layout_popup"}

<h3>修改用户套餐</h3>

<form class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>
    <input type="hidden" name="userPlanId" :value="userPlan.id"/>

    <table class="ui table definition selectable">
        <tr>
            <td class="title">用户 *</td>
            <td>
                <span v-if="userPlan.user != null"><user-link :v-user="userPlan.user"></user-link></span>
                <span v-else class="disabled">已被删除</span>
            </td>
        </tr>
        <tr>
            <td>套餐 *</td>
            <td>
                <select class="ui dropdown auto-width" name="planId" v-model="userPlan.planId">
                    <option value="0">[选择套餐]</option>
                    <option v-for="plan in plans" :value="plan.id">{{plan.name}}</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>周期 *</td>
            <td>
                <select class="ui dropdown auto-width" name="periodUnit" v-model="userPlan.periodUnit">
                    <option value="monthly">按月</option>
                    <option value="yearly">按年</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>到期日期 *</td>
            <td>
                <datepicker :v-name="'dayTo'" :v-value="userPlan.dayTo"></datepicker>
            </td>
        </tr>
    </table>

    <submit-btn></submit-btn>
</form>